
// utils.js
export function parseCsv(text) {
    const rows = text.trim().split('\n');
    const headers = rows[0].split(',');
    return rows.slice(1).map(row => {
        const values = row.split(',');
        const word = {};
        for (let i = 0; i < headers.length; i++) {
            word[headers[i]] = values[i];
        }
        return word;
    });
}